<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<table>
			<tr>
				<td>用户名:</td>
				<td><input type="text" name="u_name" id="u_name"></td>
			</tr>
			<tr>
				<td>密码:</td>
				<td><input type="password" name="u_pwd" id="u_pwd"></td>
			</tr>
			<tr>
				<td><button id="dl">登录</button></td>
			</tr>
		</table>
</body>
</html>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
	$(document).on("click","#dl",function(){

		var u_name=$("#u_name").val();
		var u_pwd=$("#u_pwd").val();
				$.ajax({

				url:"dl.php",
				type:"post",
				dataType:"json",
				data:{u_name:u_name,u_pwd:u_pwd},
				success:function(res){
					alert(res.msg);
					location.href="dl.html";
				}
			})
	})
</script>